<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
    <title th:text="${sectionName}"></title>
    <script src="/static/js/jquery-2.0.0.min.js" type="application/javascript"></script>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/static/css/bootstrap-theme.min.css" rel="stylesheet"/>
    <link href="/static/css/community.css" rel="stylesheet"/>
    <script src="/static/js/bootstrap.min.js" type="application/javascript"></script>

</head>

<body>
<!--导航栏-->
<nav th:insert="navigation :: nav"></nav>
<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h2 th:text="${sectionName}"></h2>
              <hr>
              <div class="media" th:each="question : ${pagination.questions}">
                  <div class="media-left">
                      <a href="#">
                          <img class="sm_img img-rounded" th:src="${question.user.avatarUrl}">
                      </a>
                  </div>
                  <div class="media-body">
                      <h4 class="media-heading" th:text="${sectionName}"></h4>
                      <span th:text="${question.description}"></span><br>
                      <span class="text-desc">
                              <span th:text="${question.commentCount}"></span>个回复 ·  <span
                              th:text="${question.viewCount}"></span>浏览· <span
                              th:text="${#dates.format(question.gmtCreate,'yyyy-MM-dd HH:mm')}"></span>
                          </span>
                  </div>
                  <hr>
              </div>
            <!--分页栏-->
              <nav aria-label="Page navigation" th:if="${pagination.questionCount >= pagination.pageSize}">
                  <ul class="pagination">
                      <li th:if="${pagination.showFirstPage == true}">
                          <a th:href="@{'/profile/'+${section}(page = ${1})}" aria-label="Previous">
                              <span aria-hidden="true">&laquo;</span>
                          </a>
                      </li>
                      <li th:if="${pagination.showPrevious == true}">
                          <a th:href="@{'/profile/'+${section}(page = ${pagination.page - 1})}" aria-label="Previous">
                              <span aria-hidden="true"><</span>
                          </a>
                      </li>
                      <li th:each="page:${pagination.pages}" th:class="${pagination.page == page}?'active':''">
                          <a th:text="${page}"
                             th:href="@{'/profile/'+${section}(page = ${page})}">
                          </a>
                      </li>
                      <li th:if="${pagination.showNext == true}">
                          <a th:href="@{'/profile/'+${section}(page = ${pagination.page + 1})}" aria-label="Next">
                              <span aria-hidden="true">></span>
                          </a>
                      </li>
                      <li th:if="${pagination.showEndPage == true}">
                          <a th:href="@{'/profile/'+${section}(page = ${pagination.pageCount})}" aria-label="Next">
                              <span aria-hidden="true">&raquo;</span>
                          </a>
                      </li>
                  </ul>
              </nav>
            <span th:if="${pagination.pageCount == 0}" >还没有信息！</span>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12 profile">
            <div class="list-group section">
                <a href="/profile/question" class="list-group-item"  th:classappend="${section == 'question'}?'active':''">我的提问</a>
                <a href="/profile/replies" class="list-group-item" th:classappend="${section == 'replies'}?'active':''">最新回复
                <span class="badge">12</span>
                </a>
            </div>
        </div>
    </div>
</div>
</body>
</html>